<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>教师信息添加</title>
        <script type="text/javascript">
		    function check(){
		    	if(addform.teano.value==""){
		    		alert("教师编号不能为空!");
		    		addform.teano.focus();
		    		return false;
		   	 }
		    if(addform.teaname.value==""){
		    		alert("教师姓名不能为空!");
		    		addform.teaname.focus();
		    		return false;
		    }
		    if(addform.teapwd.value==""){
			    alert("密码不能为空!");
			    addform.teapwd.focus();
			    return false;
			 }
			if(addform.teapwd.value.length<4){
			    alert("密码长度不能小于4位!");
			    addform.teapwd.focus();
			    return false;
			}
			if(isNaN(parseInt(addform.teano.value))){
			    alert("编号必须为数字!");
			    addform.teano.focus();
    			return false;
    		}
			    if(isNaN(parseInt(addform.teapwd.value))){
			    alert("密码必须为数字!");
			    addform.teapwd.focus();
			    return false;
			    }
			 if(addform.teasex.value!="男" && addform.teasex.value!="女"){
			    alert("性别必须为男或女!");
			    addform.teasex.focus();
			    return false;
			  }
			    addform.submit();
			}
    </script>
			    
		    
        
    </head>
    <body bgcolor="CCCFFF">
        <center>
            <br><br><br>
            <h3>&nbsp;&nbsp;添加教师信息</h3>
            <form action= "teanoValidate.jsp"  method="post" name="addform">
                <table border="0" width="300">
                    <tr>
                        <td>教师编号</td>
                        <td><input type="text" name="teano"></td>
                    </tr>
                    <tr>
                        <td>姓名</td>
                        <td><input type="text" name="teaname"></td>
                    </tr>
                    <tr>
                        <td>密码</td>
                        <td><input type="password" name="teapwd"></td>
                    </tr>
                    <tr>
                        <td>性别</td>
                        <td><input type="text" name="teasex" ></td>
                    </tr>
                    <tr>
                        <td>职位</td>
                        <td><input type="text" name="title" ></td>
                    </tr>
                     <tr align="center">
                        <td colspan="2">
                            <input name="sure" type="button" value="提  交" onClick="check()">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="clear" type="reset" value="取  消">
                        </td>
                    </tr>
                </table>
            </form>
        </center>
    </body>
</html>
